﻿//   该类为太阳花图案绘制
//vesion 1.0
//author 夏天的树人

package org.summerTree.graphics
{
	import flash.geom.Point;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Shape;
	public class SunFlower extends Flower 
	{
		//private var LineColor:uint=0x000000;//默认是黑色
		public function SunFlower()
		{
			
		}
		
		override public function clone():*
		{
			return new SunFlower();
		}
						
		//创建花
		/*@radius 半径
		 *@n  花瓣数
		 *@fillColor 填充颜色
		 *@alpha  图案的颜色透明度
		 *@
		 */
		public function CreatSunFlower(radius:Number,n:Number=10,fillColor:Number=0xFFFF00,alpha:Number=1):void
		{		
			CreatFlower(radius,n,fillColor,alpha);			
			CreatFace(radius);
			CreatBody(radius);
		}
			
		//创建表情
		private function CreatFace(radius:Number):void
		{
			this.graphics.beginFill(0x000000,1);
			this.graphics.drawCircle(radius/3,-radius/8,radius*0.05);
			this.graphics.endFill();
			
			this.graphics.beginFill(0x000000,1);
			this.graphics.drawCircle(-radius/3,-radius/8,radius*0.05);
			this.graphics.endFill();
			
			this.graphics.moveTo(radius/2,-radius/5);
			this.graphics.lineTo(radius/8,-radius/5);
			
			this.graphics.moveTo(-radius/2,-radius/5);
			this.graphics.lineTo(-radius/8,-radius/5);
			
			//嘴巴
			this.graphics.moveTo(-radius/3,radius/2);
			this.graphics.lineTo(radius/3,radius/2);
					
		}
		
		//创建身体
		private function CreatBody(radius:Number):void
		{
			//创建身体
			this.graphics.moveTo(0,radius);
			this.graphics.lineTo(0,3*radius);
			
			
			//创建手
			this.graphics.moveTo(0,1.5*radius);
			this.graphics.lineTo(-radius*0.8,1.8*radius);
			this.graphics.drawCircle(-radius,1.9*radius,radius/5);
			
			this.graphics.moveTo(0,1.5*radius);
			this.graphics.lineTo(radius*0.8,1.8*radius);
			this.graphics.drawCircle(radius,1.9*radius,radius/5);
			
			
			//创建脚
			this.graphics.moveTo(0,3*radius);
			this.graphics.lineTo(-0.5*radius,3.5*radius);
			this.graphics.lineTo(-0.5*radius,4*radius);
			this.graphics.lineTo(-radius,4*radius);
			
			this.graphics.moveTo(0,3*radius);
			this.graphics.lineTo(0.5*radius,3.5*radius);
			this.graphics.lineTo(0.5*radius,4*radius);
			this.graphics.lineTo(radius,4*radius);
			
			//this.graphics.moveTo(-radius,3*radius);
			
			
			//this.graphics.moveTo(radius,3*radius);
			
			
		}
		
		
		
		//
//		//设置颜色
//		public function set color(value:uint):void
//		{
//			this.LineColor=value;
//		}
//		//获取颜色
//		public function get color():uint
//		{
//			return this.LineColor;
//		}
//		//清除图像
		override public function clear():void
		{
			this.graphics.clear();
		}
//		
		
	}
	
	
}